<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>PintarOS: include/hal.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PintarOS
   </div>
   <div id="projectbrief">Operating System for Smart Card</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">hal.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Header file for HAL (Hardware Abstraction Layer)  
<a href="#details">More...</a></p>

<p><a href="hal_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:abe5394ce1dc0a256fd5047e8397020b0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#abe5394ce1dc0a256fd5047e8397020b0">HAL_IO_Config</a> (int baudrate)</td></tr>
<tr class="memdesc:abe5394ce1dc0a256fd5047e8397020b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure serial device.  <a href="#abe5394ce1dc0a256fd5047e8397020b0">More...</a><br/></td></tr>
<tr class="separator:abe5394ce1dc0a256fd5047e8397020b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bf20d3fd04aedb2ea857abb4c494586"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a9bf20d3fd04aedb2ea857abb4c494586">HAL_IO_ISR</a> ()</td></tr>
<tr class="memdesc:a9bf20d3fd04aedb2ea857abb4c494586"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serial IO Interrupt Service Routine.  <a href="#a9bf20d3fd04aedb2ea857abb4c494586">More...</a><br/></td></tr>
<tr class="separator:a9bf20d3fd04aedb2ea857abb4c494586"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a136930f47e2cdb4cdd6bc147b9703b0f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a136930f47e2cdb4cdd6bc147b9703b0f">HAL_IO_RxByte</a> ()</td></tr>
<tr class="memdesc:a136930f47e2cdb4cdd6bc147b9703b0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive 1 byte data.  <a href="#a136930f47e2cdb4cdd6bc147b9703b0f">More...</a><br/></td></tr>
<tr class="separator:a136930f47e2cdb4cdd6bc147b9703b0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44bdcc0e13a30d712528ac1aa4f2dc61"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a44bdcc0e13a30d712528ac1aa4f2dc61">HAL_IO_TxByte</a> (<a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a> data)</td></tr>
<tr class="memdesc:a44bdcc0e13a30d712528ac1aa4f2dc61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transmit 1 byte data.  <a href="#a44bdcc0e13a30d712528ac1aa4f2dc61">More...</a><br/></td></tr>
<tr class="separator:a44bdcc0e13a30d712528ac1aa4f2dc61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d06a5fa8ad09515b216326056a64de3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a3d06a5fa8ad09515b216326056a64de3">HAL_Mem_ReadByte</a> (int address)</td></tr>
<tr class="memdesc:a3d06a5fa8ad09515b216326056a64de3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read 1 byte data.  <a href="#a3d06a5fa8ad09515b216326056a64de3">More...</a><br/></td></tr>
<tr class="separator:a3d06a5fa8ad09515b216326056a64de3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5faa4d3ad25af637f0606fa329493320"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a5faa4d3ad25af637f0606fa329493320">HAL_Mem_WriteByte</a> (int address, <a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a> data)</td></tr>
<tr class="memdesc:a5faa4d3ad25af637f0606fa329493320"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write 1 byte data.  <a href="#a5faa4d3ad25af637f0606fa329493320">More...</a><br/></td></tr>
<tr class="separator:a5faa4d3ad25af637f0606fa329493320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8963fbd60ed1048b68690373edfe507"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#aa8963fbd60ed1048b68690373edfe507">HAL_Mem_Check</a> ()</td></tr>
<tr class="memdesc:aa8963fbd60ed1048b68690373edfe507"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check the integrity.  <a href="#aa8963fbd60ed1048b68690373edfe507">More...</a><br/></td></tr>
<tr class="separator:aa8963fbd60ed1048b68690373edfe507"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad8b85bbedaf1968c3eda51574aacbd4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#aad8b85bbedaf1968c3eda51574aacbd4">HAL_Mem_Init</a> ()</td></tr>
<tr class="memdesc:aad8b85bbedaf1968c3eda51574aacbd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize memory.  <a href="#aad8b85bbedaf1968c3eda51574aacbd4">More...</a><br/></td></tr>
<tr class="separator:aad8b85bbedaf1968c3eda51574aacbd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a42261e806293a1ae46f6e600c78b4a3f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42261e806293a1ae46f6e600c78b4a3f"></a>
int *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a42261e806293a1ae46f6e600c78b4a3f">Rx_callback_ptr</a></td></tr>
<tr class="memdesc:a42261e806293a1ae46f6e600c78b4a3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">pointer of Rx transmission handler to call by the interrupt handler <br/></td></tr>
<tr class="separator:a42261e806293a1ae46f6e600c78b4a3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header file for HAL (Hardware Abstraction Layer) </p>
<dl class="section author"><dt>Author</dt><dd>Ricky Hariady (<a href="#" onclick="location.href='mai'+'lto:'+'ric'+'ky'+'.ha'+'ri'+'ady'+'@e'+'nte'+'r.'+'web'+'.i'+'d'; return false;">ricky<span style="display: none;">.nosp@m.</span>.har<span style="display: none;">.nosp@m.</span>iady@<span style="display: none;">.nosp@m.</span>ente<span style="display: none;">.nosp@m.</span>r.web<span style="display: none;">.nosp@m.</span>.id</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>7/10/2013 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="abe5394ce1dc0a256fd5047e8397020b0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_IO_Config </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>baudrate</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure serial device. </p>
<p>Set the serial device speed, etc</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">baudrate</td><td>baudrate used for transmission </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="a9bf20d3fd04aedb2ea857abb4c494586"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HAL_IO_ISR </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Serial IO Interrupt Service Routine. </p>
<p>check if there a data arrive, then Call <a class="el" href="transmission_8h.html#a1de9404b5817c6a4c51eea56c32eedf3" title="Receive the command APDU. ">transRx()</a> function to collect it</p>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a136930f47e2cdb4cdd6bc147b9703b0f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a> HAL_IO_RxByte </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receive 1 byte data. </p>
<p>Receive 1 byte data from from serial IO</p>
<dl class="section return"><dt>Returns</dt><dd>the data byte received </dd></dl>

</div>
</div>
<a class="anchor" id="a44bdcc0e13a30d712528ac1aa4f2dc61"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_IO_TxByte </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a>&#160;</td>
          <td class="paramname"><em>data</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Transmit 1 byte data. </p>
<p>Transmit 1 byte data to serial IO</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>data byte to transmit v *</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="aa8963fbd60ed1048b68690373edfe507"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_Mem_Check </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check the integrity. </p>
<p>Check integrity of non-volatile memory (EEPROM/flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of memory want to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="aad8b85bbedaf1968c3eda51574aacbd4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_Mem_Init </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize memory. </p>
<p>Initialize the non-volatile memory (EEPROM/flash). Call once when OS Finalize.</p>
<dl class="section return"><dt>Returns</dt><dd>virtual size of the memory available </dd></dl>

</div>
</div>
<a class="anchor" id="a3d06a5fa8ad09515b216326056a64de3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a> HAL_Mem_ReadByte </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>address</em>)</td><td></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read 1 byte data. </p>
<p>Read 1 byte data from non-volatile memory (EEPROM/Flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of memory want to read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data readed </dd></dl>

</div>
</div>
<a class="anchor" id="a5faa4d3ad25af637f0606fa329493320"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_Mem_WriteByte </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="pintaros_8h.html#aaf0f0cca584c8202c7ee0f4a368bdd50">uint8_t</a>&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write 1 byte data. </p>
<p>Write 1 byte data to non-volatile memory (EEPROM/flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of memory want to write </td></tr>
    <tr><td class="paramname">data</td><td>data want to write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jul 10 2013 16:42:56 for PintarOS by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
